{% extends "base.html" %}
{# Page moderation des records #}

{% block title %}{{ pageTitle}}{% endblock %}

{% block additionalHeaders %}
	<link rel="stylesheet" type="text/css" href="media/css/adm_style.css" />
	<script type="text/javascript" src="media/js/admin.js"></script>
{% endblock %}

{% block content %}
	<h1>{{ pageTitle }}</h1>
	
	<form action="" method="POST">
	{{crsfToken|raw}}
    </form>
	
	
	
    {% if records %}
    <table>
    	<th>Rank</th>
    	<th>Player</th>
    	<th>Time</th>
    	<!--<th>Track Mode</th>-->
    	<!--<th>Track Type</th>-->
    	<th>Character</th>
	
    	<!--<th>Penta</th>-->
		{% if modeSelected == 2 %}
    	<th>STP</th>
    	<th>Ice</th>
		{% endif %}
    	<th>Version</th>
    	<th>Proof</th>
    	<th>Date</th>
    	<!--<th>State</th>-->

    {% for record in records %}
    	<tr>
			<td>{{ record.getRank() }}</td>
			
			<td><a href="profile.php?pid={{ record.getPlayer().getId() }}">{{ record.getPlayer().getNickname() }}</a> ({{ record.getPlayer().getCountry().getName() }})</td>
			
			<!--<td>{{ record.getTrackMode().name }}</td>-->
			<!--<td>{{ record.getTrackType().name }}</td>-->
			
			<td>{{ record }}</td>
			
			<td><img width="30px" src="{{ record.getCharacter().thumb }}" title="{{ record.getCharacter().name }}" /></td>	
		
			<!--<td>{{ record.penta }}</td>-->
			{% if modeSelected == 2 %}
			<td>{% if record.stp %}[YES]{% else %}[NO]{% endif %}</td>
			<td>{% if record.ice %}[YES]{% else %}[NO]{% endif %}</td>
			{% endif %}
			
			<td>{{ record.getVersion().name }}</td>
			<!--<td>{{ record.state }}</td>-->	
		
			<td>
				<!--<iframe title="YouTube video player" width="240" height="195" src="{{ record.getProof().url }}" frameborder="0" allowfullscreen></iframe>-->
				{% if record.getProof() %}
					<a 
						href="{{ record.getProof().url }}" 
						rel="shadowbox" 
						title="Proof: {{record.getPlayer().getNickname()}}, 
							{{record}} ==========&gt; 
							<button class='good' onclick='vp({{record.getId()}}, 1)'>valid</button>
							<button class='bad' onclick='vp({{record.getId()}}, 0)'>not valid</button>
							"
					>
						<img src="media/img/icons/eye.png" alt="see the proof" />
					</a>
				{% endif %}
			</td>
			
			<td>{{ record.getDateAgo() }} ago</td>
        </tr>
	{% endfor %}
	</table>
    {% else %}
    	No records
    {% endif %}

{% endblock content %}